package main;

import java.util.HashMap;
import java.util.Map;

public class StatisticsMap {
	
	private static Map<String, Map<String, Long>> threadLocal = new HashMap<String, Map<String,Long>>();
	
	public static Map<String, Long> getMap()
	{
		String threadName = Thread.currentThread().getName();
		Map<String, Long> map = threadLocal.get(threadName);
		if(map!=null)
		{
			return map;
		}
		return newMap(threadName);
	}
	
	public static synchronized Map<String, Long> newMap(String threadName)
	{
		Map<String, Long> map = new HashMap<String, Long>();
		threadLocal.put(threadName, map);
		return map;
	}
}
